﻿using System.Collections.Generic;

namespace dPet.Application.Services
{
	using dPet.Application.DataObjects;
	using dPet.Application.QueryObjects;
	using dPet.Infrastructure.Logging;

	public interface IProductManagementService
	{
		#region Category

		/// <summary>
		/// 添加商品大类
		/// </summary>
		MessagedResult<bool> AddProductCategory(ProductCategoryDto categoryDto, IOperator @operator);

		/// <summary>
		/// 更新商品大类
		/// </summary>
		MessagedResult<bool> UpdateProductCategory(string categoryId, ProductCategoryDto categoryDto, IOperator @operator);

		/// <summary>
		/// 获取商品大类列表
		/// </summary>
		IEnumerable<ProductCategoryDto> GetProductCategories(string hospitalId);

		/// <summary>
		/// 获取商品大类
		/// </summary>
		ProductCategoryDto GetProductCategory(string id);

		#endregion

		#region SubCategory

		/// <summary>
		/// 添加商品小类
		/// </summary>
		MessagedResult<bool> AddProductSubCategory(ProductSubCategoryDto subCategoryDto, IOperator @operator);

		/// <summary>
		/// 更新商品小类
		/// </summary>
		MessagedResult<bool> UpdateProductSubCategory(string subCategoryId, ProductSubCategoryDto subCategoryDto, IOperator @operator);

		/// <summary>
		/// 获取商品小类列表
		/// </summary>
		IEnumerable<ProductSubCategoryDto> GetProductSubCategories(string categoryId);

		/// <summary>
		/// 获取商品小类
		/// </summary>
		ProductSubCategoryDto GetProductSubCategory(string id, bool loadCategory);

		#endregion

		#region Product

		/// <summary>
		/// 添加商品
		/// </summary>
		MessagedResult<bool> AddProduct(ProductDto productDto, IOperator @operator);

		/// <summary>
		/// 更新商品
		/// </summary>
		MessagedResult<bool> UpdateProduct(string productId, ProductDto productDto, IOperator @operator);

		/// <summary>
		/// 获取商品列表
		/// </summary>
		IEnumerable<ProductDto> GetProducts(string hospitalId, bool loadCategoryAndSubCategory, bool loadInventories, ProductQueryDto queryDto,
			int pageIndex, int pageSize, out int totalNumber);

		/// <summary>
		/// 获取商品列表（销售接口）
		/// </summary>
		IEnumerable<ProductDto> GetProductsForMembership(string hospitalId, MembershipLevelDto membershipLevelDto, ProductQueryDto queryDto);

		/// <summary>
		/// 获取商品
		/// </summary>
		ProductDto GetProduct(string id, bool loadCategoryAndSubCategory, bool loadInventories);

		#endregion
	}
}
